import { createRouter, createWebHistory } from 'vue-router'
import HomePage from '@/Pages/HomePage.vue'
import UserLoginPage from '@/Pages/user/UserLoginPage.vue'
import UserRegisterPage from '@/Pages/user/UserRegisterPage.vue'
import UserManagePage from '@/Pages/admin/UserManagePage.vue'
import PictureManagePage from '@/Pages/admin/PictureManagePage.vue'
import EditPicturePage from '@/Pages/EditPicturePage.vue'
import PictureDetailPage from '@/Pages/PictureDetailPage.vue'
import AddPictureBatchPage from '@/Pages/AddPictureBatchPage.vue'
import SpaceManagePage from '@/Pages/admin/SpaceManagePage.vue'
import AddSpacePage from '@/Pages/AddSpacePage.vue'
import EditSpacePage from '@/Pages/EditSpacePage.vue'
import UpdateSpacePage from '@/Pages/UpdateSpacePage.vue'
import MySpacePage from '@/Pages/MySpacePage.vue'
import SpaceDetailPage from '@/Pages/SpaceDetailPage.vue'
import UploadPictureToMySpacePage from '@/Pages/UploadPictureToMySpacePage.vue'
import AddPicturePage from '@/Pages/AddPicturePage.vue'
import SearchPicturePage from '@/Pages/SearchPicturePage.vue'
import SpaceAnalyzePage from '@/Pages/SpaceAnalyzePage.vue'
import SpaceUserManagePage from '@/Pages/admin/SpaceUserManagePage.vue'
import PictureDetailForNotPublicPage from '@/Pages/PictureDetailForNotPublicPage.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'home',
      component: HomePage,
    },
    {
      path: '/add_picture',
      name: '创建图片',
      component: AddPicturePage,
    },
    {
      path: '/add_picture/batch',
      name: '批量创建图片',
      component: AddPictureBatchPage,
    },
    {
      path: '/upload_picture_to_my_space',
      name: '上传图片至个人云',
      component: UploadPictureToMySpacePage,
    },
    {
      path: '/edit_picture',
      name: '编辑图片',
      component: EditPicturePage,
    },
    {
      path: '/picture/:id',
      name: '图片详情',
      component: PictureDetailPage,
      props: true,
    },
    {
      path: '/pictureNoPublic/:id',
      name: '非公共图片详情',
      component: PictureDetailForNotPublicPage,
      props: true,
    },
    {
      path: '/space/:id',
      name: '空间详情',
      component: SpaceDetailPage,
      props: true,
    },
    {
      path: '/space_analyze',
      name: '空间分析',
      component: SpaceAnalyzePage,
    },
    {
      path: '/search_picture',
      name: '果酱识图',
      component: SearchPicturePage,
    },
    {
      path: '/add_space',
      name: '创建空间',
      component: AddSpacePage,
    },
    {
      path: '/edit_space',
      name: '编辑空间',
      component: EditSpacePage,
    },
    {
      path: '/user/login',
      name: '用户登录',
      component: UserLoginPage,
    },
    {
      path: '/user/register',
      name: '用户注册',
      component: UserRegisterPage,
    },
    {
      path: '/my_space',
      name: '我的云空间',
      component: MySpacePage,
    },
    {
      path: '/admin/userManage',
      name: '用户管理',
      component: UserManagePage,
    },
    {
      path: '/admin/pictureManage',
      name: '图片管理',
      component: PictureManagePage,
    },
    {
      path: '/admin/spaceManage',
      name: '空间管理',
      component: SpaceManagePage,
    },
    {
      path: '/spaceUserManage/:id',
      name: '空间成员管理',
      component: SpaceUserManagePage,
      props: true,
    },
    {
      path: '/admin/spaceAnalyze',
      name: '管理员-空间分析',
      component: SpaceAnalyzePage,
    },
    {
      path: '/admin/update_space',
      name: '更新空间',
      component: UpdateSpacePage,
    },
    {
      path: '/about',
      name: 'about',
      component: () => import('../views/AboutView.vue'),
    },
  ],
})

export default router
